package com.smallcc.util;

import com.smallcc.vo.ResultVO;

/**
 * @author 晓风过境
 * @TODO
 * @date 2018/3/28 23:34
 * @day 28
 * @return $text$
 * @title ${CLASS_NAME}
 * @project_name sell
 */
public class ResultVoUtil {
    //返回成功将对象封装给Result
    public static ResultVO sucess(Object object) {
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        return resultVO;
    }
    //什么都没有
    public static ResultVO sucess(){
        return sucess(null);
    }
    //失败
    public static ResultVO error(Integer code,String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
